package com.apache.uct.dao;

import com.apache.database.db.DaoImpl;

public class RoleGiveDaoImpl extends DaoImpl {

	public String getSql(int type) {
		String sql = "";
		switch (type) {
		case 1:
			sql = "select count(*) from RoleGive where 1=1 ";
			break;
		case 2:
			sql = " from RoleGive where 1=1 ";
			break;
		case 3:
			sql = " delete from RoleGive where ";
			break;
		case 4://获取用所有角色
			sql = " SELECT g.giveId,r.roleId,r.roleEname,r.roleCname,r.roleStatus,r.roleRemark ,r.createTime FROM Role r left join"
					+ "( select giveId,roleId,giveStatus,giveRemark,createUser FROM RoleGive where userId=:userId ) g on r.roleId=g.roleId"
					+ " where r.roleStatus=1  ";
			break;
		default:
			sql = "select count(*) from RoleGive where 1=1 ";
		}
		return sql;
	}

	public void initSystemCache() {
	}
}
